<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div :class="a"></div>
        <!-- <div :class="b?'active':''"></div> -->
        <div :class="{active:true}"></div>
        <div :class="{active:b}"></div>
        <div :class="{active:false}"></div>
        <div :class="{ active: 1==1 } "></div>
        <!-- 

            第一种 :class 的值为 {}
            此时：
                元素的类 是否是对象的key 的 前提是 key对应的值为真
         -->
         <div :class="[a,c,'box3']"></div>
         <div :class="[a,c,'box3',{active:true}]"></div>
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                a:"box",
                b:false,
                c:"box2"
            }
        })
    </script>
</body>
</html>